<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    {load file='/static/css/bootstrap.css'}
    {load file='/static/css/all.css'}
    <style>
        body{background-image:url("/images/23.jpg")}
        .m{margin: 60px auto;width: 400px;height: 360px;background-color: rgba(220, 220, 220, 0.5);
        }
    </style>
</head>
<body>
<div class="m">
    <div class="container-fluid">
        <div class="row">
            <div class="col">
                <h2 align="center" style="margin: 30px">管理员登录</h2>
                <form id="login">
                    <div class="input-group mb-4">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><i class="fas fa-user"></i></span>
                        </div>
                        <input type="search" name="id" class="form-control" placeholder="id">
                    </div>

                    <div class="input-group mb-4">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><i class="fas fa-user"></i></span>
                        </div>
                        <input type="search" name="user" class="form-control" placeholder="Username">
                    </div>

                    <div class="input-group mb-4">
                        <div class="input-group-prepend">
                    <span class="input-group-text">
                        <i class="fa fa-key" aria-hidden="true"></i>
                    </span>
                        </div>
                        <input type="search" name="pwd" class="form-control" placeholder="password">
                    </div>

                    <div class="form-group" style="text-align: center">
                        <button type="button" class="btn btn-primary" onclick="login()">登录</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>
{load file='/static/js/jquery-3.4.1.min.js'}
{load file='/static/js/bootstrap.js'}
{load file='/static/js/bootbox.js'}
<script>
    function login(){
        $.post('/index.php/hospital/admin/login',$("#login").serialize(),function(res){
            bootbox.alert(res,function (res1){
                if(res=='登录成功'){
                    window.location.href='/index.php/hospital/Booking';
                }else{
                    // window.location.href.back();
                }

            })
        })
    }
</script>